//
//  EveryDayTouTiaoCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/16.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "EveryDayTouTiaoCell.h"

@interface EveryDayTouTiaoCell ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;
@property (weak, nonatomic) IBOutlet UILabel *topLabel;
@property (weak, nonatomic) IBOutlet UILabel *bottomLabel;
@property (weak, nonatomic) IBOutlet UIView *topDian;
@property (weak, nonatomic) IBOutlet UIView *bottomDian;
@property (weak, nonatomic) IBOutlet UIView *redDian;



@end

@implementation EveryDayTouTiaoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.contentView.backgroundColor = viewBgGrey;
    
    self.topLabel.font = MYFONT(13);
    
    self.bottomLabel.font = MYFONT(13);
    
    self.topDian.layer.cornerRadius = 2;
    
    self.bottomDian.layer.cornerRadius = 2;
    
    self.topDian.layer.masksToBounds = YES;
    
    self.bottomDian.layer.masksToBounds = YES;
    
    self.redDian.backgroundColor = [UIColor redColor];
    
    self.redDian.layer.masksToBounds = YES;
    
    self.redDian.layer.cornerRadius = 3;
    
    self.bottomMargin.constant = 0;
    // Initialization code
}

- (void)setHideRedDian:(BOOL)hideRedDian{
    _hideRedDian = hideRedDian;
    
    if (_hideRedDian) {
        self.redDian.hidden = YES;
    } else {
        self.redDian.hidden = NO;

    }
    
    
}



- (void)setModels:(NSArray<HomeSubModel *> *)models{
    _models = models;
    
    self.topLabel.text = models.firstObject.jpush_content;
    
    self.bottomLabel.text = models.lastObject.jpush_content;
    
    
    
}


- (IBAction)topBtnDidTap:(UIButton *)sender {
    
    if ([self.delegate respondsToSelector:@selector(jumpMessageBtnDidClickWith:)]) {
    
        [self.delegate jumpMessageBtnDidClickWith:self.models.firstObject];
        
    }
    
}
- (IBAction)bottomBtnDidTap:(UIButton *)sender {
    
    
    if ([self.delegate respondsToSelector:@selector(jumpMessageBtnDidClickWith:)]) {
        
        [self.delegate jumpMessageBtnDidClickWith:self.models.lastObject];
        
    }
    
  
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
